<!doctype html>
<html>

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0" />
    <title>舆情工作平台</title>
    <link rel="stylesheet" type="text/css" href="../css/api.css" />
    <link rel="stylesheet" type="text/css" href="../css/common.css" />
    <style>
        /* 头部样式 */

        .topbar {
            background: #3A8B7A;
            height: 50px;
            border-bottom: 1px solid #DDDFE3;
        }

        #title {
            color: #FFF;
        }

        .swipe {
            line-height: 50px;
            margin-right: 10px;
            color: #FF8400;
        }

        .back {
            float: left;
            padding-right: 30px;
        }

        .back img {
            height: 22px;
            margin-top: 15px;
            margin-left: 10px;
            margin-bottom: 10px;
        }

        .topbar .title {
            line-height: 50px;
            font-size: 22px;
            position: absolute;
            left: 50%;
            -webkit-transform: translateX(-50%);
            transform: translateX(-50%);
        }
        /* 底部切换按钮样式 */

        ul {
            display: -webkit-box;
            display: -webkit-flex;
            display: flex;
        }

        #footer {
            height: 91px;
            line-height: 91px;
            background-color: #FAFAFA;
            border-top: 1px solid #e0e0e0;
        }

        #footer li {
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            height: 80px;
            margin-top: 10px;
        }
        /* 底部按钮样式 */
        /********************/

        .bbtn01 {
            background: url(../image/btn/yqcz_button.png) no-repeat center 4px;
        }

        .bbtn02 {
            background: url(../image/btn/rdzz_button.png) no-repeat center 4px;
        }

        .bbtn03 {
            background: url(../image/btn/yqfx_button.png) no-repeat center 4px;
        }

        .bottom_btn {
            width: 99%;
            height: 50px;
            color: red;
            padding-top: 18px;
            background-position: center;
            background-size: 50px;
            font-size: 12px;
        }

        .bottom_btn>b {
            position: relative;
            left: 35px;
            bottom: 60px;
            font-weight: bold;
        }

        .right {
            float: right;
            padding-left: 30px;
        }

        .right img {
            height: 24px;
            margin-top: 14px;
            margin-right: 14px;
        }
        /* 本地刷新图标 */

        #localrefresh {
            display: none;
            float: right;
            width: 40px;
            padding: 5px 10px;
        }

        #footer {
            height: 50px;
            background-color: #9f9f9f;
            width: 100%;
            text-align: center;
            display: -webkit-box;
            display: -webkit-flex;
            display: flex;
            border-top: 1px solid #dbdcdc;
            -webkit-box-orient: horizontal;
            -webkit-flex-flow: row;
            flex-flow: row;
        }

        #footer span {
            display: block;
            line-height: 50px;
            font-size: 14px;
            -webkit-box-flex: 1;
            -webkit-flex: 1;
            flex: 1;
            background-repeat: no-repeat;
            background-position: center 10px;
            background-size: 36px !important;
            -webkit-background-size: 36px !important;
            color: #fff;
        }
        /*#footer span.active, #footer span.act{*/
        /*background-color: #2dbd82; color: #fff;*/
        /*}*/

        #footer span:last-child {
            border-right: 0;
        }

        #footer .preview.active,
        #footer .preview.act {
            background: #3A8B7A;
        }

        #footer .code.active,
        #footer .code.act {
            background: #3A8B7A;
        }

        #thridHeader {
            padding-top: 20px;
        }
    </style>
</head>

<body>
    <div id="wrap">
        <div class="titlebar activebar">
            <div id="thridHeader" class="topbar whitebar">
                <div class="back" tapmode="" onclick="api.openSlidPane({type:'left'});">
                    <img src="../image/btn/side_button.png" alt=""></div>
                <div class="title" id="title">舆情处置</div>
                <div id="right" class="right">
                    <!--		         		<a tapmode="" onclick="goto_openWinFun(1);"><img src="../image/btn/classification.png" alt=""></a>-->
                    <a tapmode="" onclick="goto_openWinFun(2);"><img src="../image/btn/search.png" alt=""></a>
                </div>
            </div>
        </div>
        <div id="main">
        </div>
        <div id="footer">
            <span id="preview0" tapmode="active" onclick="goto_openTabFun(0)" class="preview act">舆情处置</span>
            <!-- <span id="code" tapmode="active" onclick="goto_openTabFun(1)" class="">网评数据</span> -->
            <span id="preview2" tapmode="active" onclick="goto_openTabFun(2)" class="">舆情分析</span>
        </div>
        <!--	      	<div id="footer">
	        	<ul>
	          		<li tapmode="activebtn0 activebtn" onclick="goto_openMainWinFun(1)">
	            		<a class="bottom_btn bbtn01 weixin"><b id="number"></b></a>
	          		</li>
	          		<li tapmode="activebtn1 activebtn" onClick="goto_openMainWinFun(2)">
	            		<a class="bottom_btn bbtn02 communicate"> </a>
	          		</li>
	          		<li tapmode="activebtn2 activebtn" onClick="goto_openMainWinFun(3)">
	            		<a class="bottom_btn bbtn03 discover"> </a>
	          		</li>
	        	</ul>
	      	</div>-->
    </div>
</body>
<script type="text/javascript" src="../script/api.js"></script>
<script type="text/javascript" src="../script/alpenlicebe.js"></script>
<script type="text/javascript" src="../script/zepto.min.js"></script>
<script type="text/javascript" src="../script/hashes.min.js"></script>

<script type="text/javascript">
    apiready = function() {
        api.addEventListener({
            name: 'keyback'
        }, function(ret, err) {
            api.closeWidget();
        });
        goto_getNoDealDataCountFun();
        /*注册监听事件-用户登录*/
        api.addEventListener({
            name: 'Alpe_Event_UserLogin'
        }, function(ret) {
            if (ret) {
                $("#pageIndex").val(0);
                $("#main_content").html("");
                $("#textTip").html("正在加载..");
                goto_getNoDealDataCountFun();

            }
        });
        /*获取头部和底部的相关信息，计算子窗口的高度及y坐标*/
        var header = $api.byId('thridHeader');
        $api.fixIos7Bar(header);
        var headerOffset = $api.offset(header);

        var footer = $api.byId('footer');
        var footerPos = $api.offset(footer);

        api.openFrame({
            name: 'yq_DealOther',
            url: './yq_DealOther.html',
            rect: {
                x: 0,
                y: headerOffset.h,
                w: 'auto',
                h: api.frameHeight - headerOffset.h - footerPos.h
            },
            pageParam: {
                winY: headerOffset.h
            },
            delay: 300,
            bounces: false,
            reload: true,
            showProgress: 'true'
        });
    };
    function goto_openTabFun(openID) {
        // api.closeFrameGroup({
        //     name: 'groupYQDeal'
        // });
        // api.closeFrameGroup({
        //     name: 'group_sjtj'
        // });
        // api.closeFrameGroup({
        //     name: 'group_Task'
        // });
        var header = $api.byId('thridHeader');
        var headerOffset = $api.offset(header);
        var footer = $api.byId('footer');
        var footerPos = $api.offset(footer);
        $(".preview").removeClass();
        $("#title").text($("#preview" + openID).text());
        if (openID == 0) {
            $("#right").html('<a tapmode="" onclick="goto_openWinFun(2);"><img src="../image/btn/search.png" alt=""></a>');
        } else {
            $("#right").html('')
        }

        if (0 == openID) {
            $("#preview0").addClass("preview act");
            api.openFrame({
                name: 'yq_DealOther',
                url: './yq_DealOther.html',
                rect: {
                    x: 0,
                    y: headerOffset.h,
                    w: 'auto',
                    h: api.frameHeight - headerOffset.h - footerPos.h
                },
                pageParam: {
                    winY: headerOffset.h,
                    winH: api.frameHeight - headerOffset.h - footerPos.h
                },
                delay: 300,
                bounces: false,
                reload: true,
                showProgress: 'true'
            });
        }else if (2 == openID) {
            $("#preview2").addClass("preview act");

            api.openFrame({
                name: 'sjtj_IndexPage',
                url: './sjtj_IndexPage.html',
                rect: {
                    x: 0,
                    y: headerOffset.h,
                    w: 'auto',
                    h: api.frameHeight - headerOffset.h - footerPos.h
                },
                pageParam: {
                    winY: headerOffset.h,
                    winH: api.frameHeight - headerOffset.h - footerPos.h
                },
                delay: 300,
                bounces: false,
                reload: true,
                showProgress: 'true'
            });

        }
    }
    function goto_getNoDealDataCountFun() {
        var MD5 = new Hashes.MD5;
        var access_token = Alpe_getLocalStorge("access_token");
        var admin_id = Alpe_getLocalStorge("admin_id");
        var sign = MD5.hex(access_token + admin_id + 'datas/infoTotal1.0syjqingbao');

        var url = Alpe_ApiUrl + 'r=datas/infoTotal&access_token=' + access_token + '&admin_id=' + admin_id +
            '&v=1.0&sign=' + sign;
        api.ajax({
            url: url,
            method: 'get',
            cache: false,
            timeout: 30,
            dataType: 'json'
        }, function(ret, err) {
            if (ret.success == '100') {
                $("#number").html(ret.list[0]);
            }
        });
    }

    function goto_openMainWinFun(winIndex) {
        var winName = "userPWD";
        if (1 == winIndex) {
            winName = "list_mryq_top";
        } else if (2 == winIndex) {
            winName = "hot_Track";
        } else if (3 == winIndex) {
            winName = "tjfx_Index";
        } else {
            winName = "userPWD";
        }
        var delay = 0;
        if ("ios" != api.systemType) {
            delay = 300;
        }
        api.openWin({
            name: winName,
            url: "./" + winName + ".html",
            pageParam: {
                winName: winName
            },
            bounces: false,
            vScrollBarEnabled: false,
            hScrollBarEnabled: false,
            reload: true,
            delay: delay
        });
    }

    function goto_openWinFun(winIndex) {
        var winName = "yq_listSearch";
        if (1 == winIndex) {
            winName = "yq_listCate";
        } else {
            winName = "yq_listSearch";
        }
        var delay = 0;
        if ("ios" != api.systemType) {
            delay = 300;
        }
        api.openWin({
            name: winName,
            url: "./" + winName + ".html",
            pageParam: {
                winName: winName
            },
            bounces: false,
            vScrollBarEnabled: false,
            hScrollBarEnabled: false,
            reload: true,
            delay: delay
        });
    }
</script>

</html>
